package 策略模式;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
   public static Map<Integer,Object> map=new HashMap<>();
    static {
        map.put(1,new CommonDiscount());
        map.put(2,new GreatDiscount());
    }
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        int x=new Scanner(System.in).nextInt();
         //调用策略类的实现
        DiscountStrategy dis = new DiscountStrategy((discount) map.get(x));
        double calculate = dis.calculate(100);
        System.out.println(calculate);
    }
}
